package com.example.coder_voucher.exception;

public class VoucherNotAvailableException extends RuntimeException {
    
    public VoucherNotAvailableException(String message) {
        super(message);
    }
    
    public VoucherNotAvailableException(String message, Throwable cause) {
        super(message, cause);
    }
    
    public static VoucherNotAvailableException expired(String voucherCode) {
        return new VoucherNotAvailableException("Voucher " + voucherCode + " has expired");
    }
    
    public static VoucherNotAvailableException soldOut(String voucherCode) {
        return new VoucherNotAvailableException("Voucher " + voucherCode + " is sold out");
    }
    
    public static VoucherNotAvailableException inactive(String voucherCode) {
        return new VoucherNotAvailableException("Voucher " + voucherCode + " is inactive");
    }
    
    public static VoucherNotAvailableException notStarted(String voucherCode) {
        return new VoucherNotAvailableException("Voucher " + voucherCode + " is not available yet");
    }
}